<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%> 
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">
<html>
<head>
    <base href="<%=basePath%>">
    <title>优标检测网</title>
    <!-- 浏览器上显示title 图标 icon图标 -->
	<link type="image/x-icon" rel="icon" href="<%=basePath %>resource/img/minilogo.png">

	<!-- 如果想让图标出现在收藏夹中，就：  -->
	<link type="image/x-icon" rel="shortcut icon" href="<%=basePath %>resource/img/minilogo.png">
	<link type="image/x-icon" rel="bookmark" href="<%=basePath %>resource/img/minilogo.png">
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="优标">
	<meta http-equiv="description" content="优标">
    <link href="<%=basePath %>portal/css/main.css" type="text/css" rel="stylesheet">
    <link href="<%=basePath %>portal/css/datepickerbootstrap.css" type="text/css" rel="stylesheet">
    <title>用户注册</title>
</head>
<body>

<%@include file="p_head.jsp"%>

<div class="NCContent">
    <div class="NCNewsHead">
        <div class="MainPage">
            <div class="NCMain">
                <h2 class="NCHeadWord">个人中心 / Personal Center</h2>
            </div>
        </div>
    </div>
    <div class="NCNewsList">
        <div class="MainPage">
            <div class="NCMain">
                <div class="NCNewsListContent">
                    <div class="QCTitleContentHead">用户注册</div>
                    <a href="javascript:history.back()" class="SCBackBtn">返回</a>
                    <div class="QCCreateBody">
                        <div class="RegisterContent">
                            <div class="RegStepBox">
                                <div class="RegStep">
                                    第一步<br/>
                                    选择账户类型
                                </div>
                                <div class="RegStep RegStepAct">
                                    第二部<br/>
                                    填写注册信息
                                </div>
                                <div class="RegStep">
                                    第三步<br/>
                                    注册完成
                                </div>
                            </div>
                            <div class="QCCreateContent">
								<form action="<%=basePath%>reg_company.action" method="post" id="regCompanyForm" enctype="multipart/form-data">
								<input type="hidden" name="accountType" id="accountType" value="${accountType}" />
                                <div class="QCCreateBox">
                                    <div class="QCCreateHeadWord1">机构名称</div>
                                    <div class="QCCreateMain">
                                        <input id="compName" name="compName" class="QCCStandard" type="text"/>
                                        <span style="display:none;" class="RegMsg">*机构名称不能为空</span>
                                    </div>
                                    <div class="QCCreateHeadWord2">机构性质</div>
                                    <div class="QCCreateMain">
										<select name="compNature" id="compNature" class="QCCTag">
											<c:forEach var="nature" items="${natureStr}">
												<option value="${nature.dicKey}">${nature.dicValue}</option>
											</c:forEach>
										</select>
                                    </div>
                                </div>
                                <div class="QCCreateBox">
                                    <div class="QCCreateHeadWord1">联系人</div>
                                    <div class="QCCreateMain">
                                        <input id="linkMan" name="linkMan" class="QCCStandard" type="text"/>
                                        <span style="display:none;" class="RegMsg">*联系人不能为空</span>
                                    </div>
                                    <div class="QCCreateHeadWord2">联系电话</div>
                                    <div class="QCCreateMain">
                                        <input id="phone" name="phone" class="QCCStandard" type="text"/>
                                        <span style="display:none;" class="RegMsg">*手机号格式不正确</span>
                                    </div>
                                </div>
                                <div class="QCCreateBox">
                                    <div class="QCCreateHeadWord1">机构地址</div>
                                    <div class="QCCreateMain">
                                        <input id="address" name="address" class="QCCStandard" type="text"/>
                                        <span style="display:none;" class="RegMsg">*机构地址不能为空</span>
                                    </div>
                                    <div class="QCCreateHeadWord2">电子邮箱</div>
                                    <div class="QCCreateMain">
                                        <input id="email" name="email" class="QCCStandard" type="text"/>
                                        <span class="RegMsg">注意：邮箱账号将作为您的登陆账号</span>
                                    </div>
                                </div>
                                <div class="QCCreateBox">
                                    <div class="QCCreateHeadWord1">登录密码</div>
                                    <div class="QCCreateMain">
                                        <input id="password" name="password" class="QCCStandard" type="password"/>
                                        <span style="display:none;" class="RegMsg">*密码不能为空</span>
                                    </div>
                                    <div class="QCCreateHeadWord2">重复密码</div>
                                    <div class="QCCreateMain">
                                        <input id="password2" name="password2" class="QCCStandard" type="password"/>
                                        <span style="display:none;" class="RegMsg">*两次密码不符</span>
                                    </div>
                                </div>
                                <div class="QCCreateBox">
                                    <div class="QCCreateHeadWord1">传真</div>
                                    <div class="QCCreateMain">
                                        <input id="fax" name="fax" class="QCCStandard" type="text"/>
                                    </div>
                                    <div class="QCCreateHeadWord3">cnas认可实验室</div>
                                    <div class="QCCreateMain">
                                        <input id="cnasFlag" name="cnasFlag" type="checkbox"/>
                                    </div>
                                </div>
                                <div class="RegStep2Title">请将证明文件拍照上传，以便后台进行审核处理</div>
                                <div class="QCCreateBox2">
                                    <div class="QCCreateHeadWord1">证件1</div>
                                    <div class="QCCreateMain2">
                                        <div class="QCCUploadImg">
                                            <img id="imgPhoto" src=""/>
                                            <div id="divPreview1"></div>
                                        </div>
                                        <input id="img1" name="img1" class="QCCUpload" type="file" onchange="PreviewImage(this,'imgPhoto','divPreview1');"/>
                                        <span style="display:none;bottom:0" class="RegMsg">*证件1上传的文件不是图片类型</span>
                                    </div>
                                </div>
                                <div class="QCCreateBox2">
                                    <div class="QCCreateHeadWord1">证件2</div>
                                    <div class="QCCreateMain2">
										<div class="QCCUploadImg">
                                            <img id="imgPhoto2" src=""/>
                                            <div id="divPreview2"></div>
                                        </div>
                                        <input id="img2" name="img2" class="QCCUpload" type="file"
										onchange="PreviewImage(this,'imgPhoto2','divPreview2');"/>
										<span style="display:none;bottom:0" class="RegMsg">*证件2上传的文件不是图片类型</span>
                                    </div>
                                </div>
								</form>
                            </div>
                        </div>
                        <div class="QCCSubmitBox">
                            <span class="BtnCss QCCSubmitBtn">下一步</span>
                        </div>
                        <div style="clear:both"></div>
                    </div>
                    <div class="NCNewsListContentFoot"></div>
                </div>
            </div>
        </div>
    </div>
</div>
<%@include file="p_foot.jsp"%>
</body>
<script src="<%=basePath %>portal/js/res/jquery-1.4.2.min.js"></script>
<script src="<%=basePath %>portal/js/res/responsiveslides.min.js"></script>
<script src="<%=basePath %>portal/js/res/zebra_datepicker.src.js"></script>
<script src="<%=basePath %>portal/js/page/base.js"></script>
<script src="<%=basePath %>portal/js/page/register.js"></script>
<script src="<%=basePath %>admin/assets/jquery-easyui-1.4.3/jquery.min.js"></script>
<script src="<%=basePath %>admin/assets/jquery-easyui-1.4.3/jquery.easyui.min.js"></script>
<script src="<%=basePath %>admin/assets/jquery-easyui-1.4.3/locale/easyui-lang-zh_CN.js"></script>
<script>
$('#regCompanyForm').form({
    onSubmit: function() {
        return $(this).form('validate');
    },
    success: function(data) {
		var mydata = JSON.parse(data);
		switch(mydata.result) {
		case 0:
			window.location="<%=basePath%>reg_step4.action";
			break;
		case 1:
			$("#compName").parent().find(".RegMsg").html(mydata.msg).show();
			break;
		case 2:
			$("#linkMan").parent().find(".RegMsg").html(mydata.msg).show();
			break;
		case 3:
		case 4:
			$("#phone").parent().find(".RegMsg").html(mydata.msg).show();
			break;
		case 5:
		case 6:
			$("#email").parent().find(".RegMsg").html(mydata.msg).show();
			break;
		case 7:
			$("#password").parent().find(".RegMsg").html(mydata.msg).show();
			break;
		case 8:
			$("#password2").parent().find(".RegMsg").html(mydata.msg).show();
			break;
		case 9:
		case 10:
			$("#img1").parent().find(".RegMsg").html(mydata.msg).show();
			break;
		case 11:
		case 12:
			$("#img2").parent().find(".RegMsg").html(mydata.msg).show();
			break;
		case 13:
			$("#email").parent().find(".RegMsg").html(mydata.msg).show();
			break;
		case 14:
			$("#img2").parent().find(".RegMsg").html(mydata.msg).show();
			break;
		case 15:
			$("#img2").parent().find(".RegMsg").html(mydata.msg).show();
			break;
		case 16:
			$("#address").parent().find(".RegMsg").html(mydata.msg).show();
			break;
		}
	}
});
$(".QCCSubmitBtn").click(function(){
	var flag = true;
    flag = checkcompanyname();
    flag = checkusername();
    flag = checkpassword();
    flag = checkphone();
    flag = checkemail();
	flag = checkaddress();
    
	if (flag)
		$('#regCompanyForm').submit();
});
</script>
</html>